//
// Created by Tiany on 2021/6/21.
//顺序结构型栈的测试

#include <stdio.h>
#include "SeqStack.h"

static void SeqStackTest(void) {
    struct DataType x[] = {141, 15, 13, 1, 65, 32, 1, 65, 1, 31, 6, 1, 23, 531, 1, 1, 31, 51, 4};
    int length = sizeof(x) / sizeof(x[0]);
    printf("%d", length);
    PSeqStack pSeqStack;
    pSeqStack = createEmptyStack_seq(length * 2);/*创建两倍数组长的栈*/
    for (int i = 0; i < length; i++) {
        push_seq(pSeqStack, x[i]);/*循环进栈*/
    }
    printf("\n栈顶元素：%d", (top_seq(pSeqStack)).n);/*打印栈顶元素*/
    pop_seq(pSeqStack);/*栈顶元素出栈*/
    printf("\n栈顶元素：%d", (top_seq(pSeqStack)).n);/*取新栈顶元素*/

}

